package com.diaohw.platform.remote.auth.obj.bo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serial;
import java.io.Serializable;

/**
 * 用户登录日志 DTO
 *
 * @author D-Hw
 * @since 2024-07-08
 */
@Data
@Accessors(chain = true)
@Schema(name = "AccountLoginLog", description = "用户登录日志 DTO")
public class LoginLogBO implements Serializable {


    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 用户id
     */
    @Schema(description = "用户id")
    private String accountId;

    /**
     * 用户登录账号
     */
    @Schema(description = "用户登录账号")
    private String username;

    /**
     * 用户昵称
     */
    @Schema(description = "用户昵称")
    private String nickname;

    /**
     * 登录IP
     */
    @Schema(description = "登录IP")
    private String loginIp;

    /**
     * 浏览器
     */
    @Schema(description = "浏览器")
    private String loginBrowser;


    public static LoginLogBO create(String accountId, String username, String nickname, String loginIp, String loginBrowser) {
        LoginLogBO log = new LoginLogBO();

        log.accountId = accountId;
        log.loginBrowser = loginBrowser;
        log.loginIp = loginIp;
        log.username = username;
        log.nickname = nickname;
        return log;
    }

}
